package cn.com.pc.content.dto;

import cn.com.pc.content.domain.content.ContentType;
import cn.com.pc.content.domain.Site;
import cn.com.pc.content.domain.tag.TagHistory;
import lombok.Data;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

import java.time.LocalDateTime;

@Data
@ToString
public class TagHistoryDTO {
    private Long id;
    private String contentId;
    private ContentType contentType;
    private Site site;
    private String tagBy;
    private LocalDateTime tagAt;
    private Long tagId;

    public static TagHistoryDTO from(TagHistory tagHistory) {
        TagHistoryDTO tagHistoryDTO = new TagHistoryDTO();
        BeanUtils.copyProperties(tagHistory, tagHistoryDTO);
        return tagHistoryDTO;
    }
}
